{# Copyright 2015 Siemens AG

   Copying and distribution of this file, with or without modification,
   are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
   This file is offered as-is, without any warranty.
#}

<spdx:hasFile>
  <spdx:File rdf:about="{{ uri }}#SPDXRef-item{{ fileId|url_encode }}">
    <spdx:fileName>{{ fileName|e }}</spdx:fileName>
    <spdx:checksum>
      <spdx:Checksum>
        <spdx:algorithm rdf:resource="http://spdx.org/rdf/terms#checksumAlgorithm_sha1" />
        <spdx:checksumValue>{{ sha1 | lower }}</spdx:checksumValue>
      </spdx:Checksum>
    </spdx:checksum>
    <spdx:checksum>
      <spdx:Checksum>
        <spdx:algorithm rdf:resource="http://spdx.org/rdf/terms#checksumAlgorithm_sha256" />
        <spdx:checksumValue>{{ sha256 | lower }}</spdx:checksumValue>
      </spdx:Checksum>
    </spdx:checksum>
    <spdx:checksum>
      <spdx:Checksum>
        <spdx:algorithm rdf:resource="http://spdx.org/rdf/terms#checksumAlgorithm_md5" />
        <spdx:checksumValue>{{ md5 | lower }}</spdx:checksumValue>
      </spdx:Checksum>
    </spdx:checksum>
{% if isCleared %}
{% if concludedLicenses|default is empty %}
    <spdx:licenseConcluded rdf:resource="http://spdx.org/rdf/terms#none" />
{% else %}
    <spdx:licenseConcluded>
      <spdx:DisjunctiveLicenseSet>
{% for res in concludedLicenses %}
{% if res starts with 'LicenseRef-' %}
        <spdx:member rdf:resource="{{ uri }}#{{ res|replace({' ': '-'})|url_encode }}" />
{% else %}
        <spdx:member rdf:resource="http://spdx.org/licenses/{{ res|replace({' ': '-'})|url_encode }}" />
{% endif %}
{% endfor %}
      </spdx:DisjunctiveLicenseSet>
    </spdx:licenseConcluded>
{% endif %}
{% else %}
    <spdx:licenseConcluded rdf:resource="http://spdx.org/rdf/terms#noassertion" />
{% endif %}
{% if licenseCommentState %}
{% if licenseComment is empty %}
    <spdx:licenseComments rdf:resource="http://spdx.org/rdf/terms#noassertion" />
{% else %}
    <spdx:licenseComments><![CDATA[{{ licenseComment|e }}]]></spdx:licenseComments>
{% endif %}
{% endif %}
{% if scannerLicenses|default is empty %}
    <spdx:licenseInfoInFile rdf:resource="http://spdx.org/rdf/terms#noassertion" />
{% else %}{% for res in scannerLicenses %}
{% if res starts with 'LicenseRef-' %}
    <spdx:licenseInfoInFile rdf:resource="{{ uri }}#{{ res|replace({' ': '-'})|url_encode }}" />
{% else %}
    <spdx:licenseInfoInFile rdf:resource="http://spdx.org/licenses/{{ res|replace({' ': '-'})|url_encode }}" />
{% endif %}
{% endfor %}{% endif %}
{% if copyrights|default is empty %}
    <spdx:copyrightText rdf:resource="http://spdx.org/rdf/terms#noassertion" />
{% else %}    <spdx:copyrightText><![CDATA[
{% for cp in copyrights %}
      {{ cp|replace({'\f':''})
           |replace({']]>':']]]]><![CDATA[>'}) }}
{% endfor %}
    ]]></spdx:copyrightText>
{% endif %}
  </spdx:File>
</spdx:hasFile>
